package com.liu.jdbc.dao_.test;

import com.liu.jdbc.dao_.dao.GoodsDao;
import com.liu.jdbc.dao_.domian.Goods;
import org.junit.Test;

import java.util.List;

public class testGoodsDao {
    @Test
    public void test() {
        GoodsDao goodsDao = new GoodsDao();
        //1.添加
        //goodsDao.update("insert into goods values(?,?,?)",40,"菠萝手机",5000);
        //2.返回查询
        List<Goods> goods = goodsDao.queryMulti("select * from goods where id >= ?",Goods.class,10);
        System.out.println("======================");
        for (Goods good : goods) {
            System.out.println(good);
        }
//        Goods goods1 = goodsDao.querySingle("select * from goods where id = ?", Goods.class , 10);
//        System.out.println("=============");
//        System.out.println(goods1);
            //查看单行单列
//        Object o = goodsDao.queryScalar("select goods_name from goods where id = ?", 10);
//        System.out.println(o);
    }
}
